﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data;
using DataAccess;
using Utility;

namespace Web.giaovien
{
    public partial class UCThongBao : System.Web.UI.UserControl
    {
        ThongBaoControl tbCtr = new ThongBaoControl();
        ThongBao tb = new ThongBao();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadThongBao();
            }
        }

        private void LoadThongBao()
        {
            GridView1.DataSource = tbCtr.GetListThongBao();
            GridView1.DataBind();
        }

        protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            int id = Int32.Parse(WebHelper.GetIdGridView(GridView1 , 0 ,e));
            Response.Redirect("giaovienpage.aspx?page=chitiet&id="+id+"");
        }

    
    }
}